﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1
{
    //1、音乐老师（既是老师，又是游泳运动员，又是作家），需要有一种结构，音乐老师继承老师，同时继承运动员。
    //程序员（既是员工，又是作家），需要有一种结构，程序员继承员工，同时继承作家。
    class person
    {
        private string name;
        private string sex;

        public string Name { get => name; set => this.name = value; }
        public string Sex { get => sex; set => this.sex = value; }

        public person(string name,string sex) {
            this.name = name;
            this.sex = sex;
        } 
        public person() { }
    }
    interface IWrite
    {
        void Write();
    }
    interface ITeacher
    {
        void  Teach();
    }
    
    interface ISwim
    {
        void Swim();
    }
    interface IStaff
    {
        void Staff();
    }
    class Teacher : person, IWrite, ITeacher, ISwim
    {
        public void Write() {
            Console.WriteLine("我会写作");
        }

        public void Teach()
        {
            Console.WriteLine("我会教书育人");
        }

        public void Swim()
        {
            Console.WriteLine("我是游泳运动员");

        }
        public void Watch()
        {
            Console.WriteLine("性别为{0}的{1}正在游泳中", this.Sex, this.Name);
        }
        public void Sleep()
        {
            Console.WriteLine("性别为{0}的{1}正在呼呼大睡", this.Sex, this.Name);
        }
        public Teacher(string sex,string name):base (sex ,name ){
        
        }
    }
    class Programer :person ,IWrite, IStaff 
        {
        

        public void Write()
        {
            Console.WriteLine("我会写出一篇程序书");
        }
        public void Staff()
        {
            Console.WriteLine("是一个公司高层管理员");
        }
        public void Watch()
        {

            Console.WriteLine("性别为{0}的{1}正在看篮球比赛",this .Sex ,this .Name );
        }
        public void Sleep()
        {
            Console.WriteLine("性别为{0}的{1}正在床上呼呼大睡",this .Sex ,this.Name );
        }
        public Programer(string sex,string name):base (sex ,name )
        {

        }
    }

   
}
